package org.company.tool.bean;

/**
 * 描述数据库字段、javaBean属性
 * @ClassName:ColumnBean.java
 * Title:
 * Description:
 * Copyright:Copyright(c)2012
 * Company:www.si-tech.com.cn
 * @author:hucw
 * @date:2012-12-11
 * @version 1.0
 */
public class ColumnBean{
	
    /**
     * 数据库字段名称
     */
	private String column;
	/**
	 * javaBean 属性名称
	 */
	private String property;
	/**
	 * 数据库数据类型
	 */
	private String dataType;
	
	/**
	 * java数据类型
	 */
	private String jdbcType;
	
	/**
	 * 大写字母
	 */
	private String upperProperty;
	/**
	 * 是否数据库主键
	 */
	private Boolean isPrimaryKey = false;
	
	private Integer columnSize = 0;
	
	public String getColumn() {
		return column;
	}
	
	public void setColumn(String column) {
		this.column = column;
	}
	
	public String getProperty() {
		return property;
	}
	
	public void setProperty(String property) {
		this.property = property;
	}
	
	public String getDataType() {
		return dataType;
	}
	
	public void setDataType(String dataType) {
		this.dataType = dataType;
	}
	
	public String getUpperProperty() {
		return upperProperty;
	}
	
	public void setUpperProperty(String upperProperty) {
		this.upperProperty = upperProperty;
	}
	
	public Boolean getIsPrimaryKey() {
		return isPrimaryKey;
	}
	
	/**
     * @param isPrimaryKey the isPrimaryKey to set
     */
    public void setIsPrimaryKey(Boolean isPrimaryKey) {
        this.isPrimaryKey = isPrimaryKey;
    }
	
	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return this.column.hashCode();
	}
	
	/**
     * @return the jdbcType
     */
    public String getJdbcType() {
        return jdbcType;
    }

    /**
     * @param jdbcType the jdbcType to set
     */
    public void setJdbcType(String jdbcType) {
        this.jdbcType = jdbcType;
    }
    
    /**
     * @return the columnSize
     */
    public Integer getColumnSize() {
        return columnSize;
    }

    /**
     * @param columnSize the columnSize to set
     */
    public void setColumnSize(Integer columnSize) {
        this.columnSize = columnSize;
    }

    @Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		ColumnBean bean = (ColumnBean)obj;
		return this.hashCode() == bean.hashCode();
	}
}
